"use strict"

/**
 * 安徽省政府采购网爬虫
 *  
 */

var Base = require("./base");
var ah_spider = new Base();
ah_spider.name = "安徽省政府采购网";
ah_spider.page = 1;
ah_spider.encode = "utf-8";

ah_spider.getPageUrl = function (pageIndex) {
    return `http://www.ahzfcg.gov.cn/indexController/indexMain?pageNum=${pageIndex}&countPerPage=20`;
};

ah_spider.getItems = function ($) {
    var items = [];
    $("ul li a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.ahzfcg.gov.cn/" + e.attr("href");
        item.source = ah_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = ah_spider;
